﻿using System.Web.Mvc;
using System.Web.Routing;
using Nop.Web.Framework.Mvc.Routes;

namespace Nop.Plugin.Payments.PayPalExpress
{
    public partial class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute("Plugin.Payments.PayPalExpress.Configure",
                 "Plugins/PaymentPayPalExpress/Configure",
                 new { controller = "PaymentPayPalExpress", action = "Configure" },
                 new[] { "Nop.Plugin.Payments.PayPalExpress.Controllers" }
            );

            routes.MapRoute("Plugin.Payments.PayPalExpress.PaymentInfo",
                 "Plugins/PaymentPayPalExpress/PaymentInfo",
                 new { controller = "PaymentPayPalExpress", action = "PaymentInfo" },
                 new[] { "Nop.Plugin.Payments.PayPalExpress.Controllers" }
            );

            //Submit PayPal Express Checkout button
            routes.MapRoute("Plugin.Payments.PayPalExpress.SubmitButton",
                 "Plugins/PaymentPayPalExpress/SubmitButton",
                 new { controller = "PaymentPayPalExpress", action = "SubmitButton" },
                 new[] { "Nop.Plugin.Payments.PayPalExpress.Controllers" }
                 );

            //Get PayPal Express Checkout details
            routes.MapRoute("Plugin.Payments.PayPalExpress.GetDetails",
                 "Plugins/PaymentPayPalExpress/GetDetails",
                 new { controller = "PaymentPayPalExpress", action = "GetDetails"},
                 new[] { "Nop.Plugin.Payments.PayPalExpress.Controllers" }
                 );

            //PDT
            routes.MapRoute("Plugin.Payments.PaymentPayPalExpress.PDTHandler",
                 "Plugins/PaymentPayPalExpress/PDTHandler",
                 new { controller = "PaymentPayPalExpress", action = "PDTHandler" },
                 new[] { "Nop.Plugin.Payments.PaymentPayPalExpress.Controllers" }
            );
            //IPN
            routes.MapRoute("Plugin.Payments.PayPalExpress.IPNHandler",
                 "Plugins/PaymentPayPalExpress/IPNHandler",
                 new { controller = "PaymentPayPalExpress", action = "IPNHandler" },
                 new[] { "Nop.Plugin.Payments.PayPalExpress.Controllers" }
            );
        }
        public int Priority
        {
            get
            {
                return 0;
            }
        }
    }
}
